<template>
	<div class="sigin">
		<div class="sigin-container">
			<div class="sigin-header">
				<div class="sigin-header-title">您的可用积分为</div>
				<div class="sigin-header-integral">999</div>
			</div>
			<div class="sigin-slider"></div>
			<div class="sigin-btn">
				<button>签到</button>
			</div>
			<div class="sigin-content">
				<sigin-item v-for="item in siginList" :key="item.id" :siginItem="item"/>
			</div>
		</div>
		<go-back/>
	</div>
</template>

<script>
	import Score from '@/services/score';
	import GoBack from '#/Public/GoBack';
	import siginItem from '#/Sigin/siginItem';

	const _score = new Score();
	export default {
		name: "Sigin",
		data() {
			return {
				siginList: [
					{
						id: 1,
						pic: require('@/assets/img/shopping.jpg'),
						title: '消费购物',
						detail: '购物完成，确认收货后立返积分',
						btnText: '去购物',
						linkUrl: '/'
					},
					{
						id: 2,
						pic: require('@/assets/img/points.jpg'),
						title: '积分兑换',
						detail: '积分兑好礼，20积分即可兑换礼券',
						btnText: '去兑换',
						linkUrl: '/gift'
					}
				],
				rulesList: []
			}
		},
		created() {
			this.getSignRules();
		},
		methods: {
			getSignRules() {
				_score.getSignRules().then(res => {
					this.rulesList = res.data;
					console.log(res.data);
				})
			}
		},
		components: {
			GoBack,
			siginItem
		}
	}
</script>
